package cn.utils;

import java.io.File;

/**
 * @describe: 将当前模块的文件路径转成相对路径
 * @author: ReeyGu
 * @data: 2024/3/28 13:01
*/
public class GetPath {

    // 模块内路径间用 / 分割
    public static String toPath(String currUrl) {
        String[] urls = currUrl.split("/");
        StringBuilder tarUrl = new StringBuilder(System.getProperty("user.dir"));
        for (int i = 0; i < urls.length; i++) {
            tarUrl.append(File.separator);
            tarUrl.append(urls[i]);
        }
        return tarUrl.toString();
    }
}
